<?php

header('content-type:text/html;charset=utf-8;');

$uname = $_GET['username'];//获取前端传递的用户名
$upass = $_GET['password'];//获取前端传递的密码


$link = mysqli_connect('localhost','root','','jingdong');
mysqli_set_charset($link,"utf8");
$sql = "SELECT * FROM `user` WHERE `name`='$uname' AND `pwd`='$upass'";
$result = mysqli_query($link,$sql);
$row = mysqli_fetch_row($result);
mysqli_close($link);
if($row){
    //如果登陆成功
   echo "1"; 
}else{
    echo "0";
}

?>